// /*
//  * @Author: songyingchun
//  * @Date: 2023-04-18 10:10:35
//  * @Description: 
//  */

// /** @format */
// import { setStore } from "../utils/store";

// let apiRoot;
// let clientSecret; //后端提供

// //主应用clientId
// const clientId = "eaf8c4c2-ce72-47c6-bdc6-b6831204097a"; //平台里面创建

// //子应用menuId
// const appId = "1534425761879654401"; //平台里面创建，必改
// let domain = 'https://crs.dev.harsonserver.com/#/'

// if (process.env.VUE_APP_PROFILE === "development") {
//     apiRoot = "https://hscsf.dev.harsonserver.com";
//     domain = 'http://localhost:8014/#/'
//     clientSecret = "593496da-2c7a-4146-b81a-4301b66d5ef3";
//     // clientSecret = '93f9f226-ef20-473a-b867-ffeffbbe2aca'  // 生产

//     //下面的代码不要动，供开发人员调试公共组件
//     if (apiRoot.indexOf("hscsf.dev") != -1) {
//         setStore("env", "dev");
//     }

//     if (apiRoot.indexOf("test") != -1) {
//         setStore("env", "test");
//     }

//     if (apiRoot.indexOf("hscsf-pre") != -1) {
//         setStore("env", "pre");
//     }

//     if (apiRoot.indexOf("cloud") != -1) {
//         setStore("env", "cloud");
//     }
// }
// if (process.env.VUE_APP_PROFILE === "dev") {
//     apiRoot = "https://hscsf.dev.harsonserver.com";
//     clientSecret = "593496da-2c7a-4146-b81a-4301b66d5ef3";
//     domain = 'https://crs.dev.harsonserver.com/#/'
// }

// if (process.env.VUE_APP_PROFILE === "staging") {
//     apiRoot = "https://hscsf.test.harsonserver.com";
//     clientSecret = "593496da-2c7a-4146-b81a-4301b66d5ef3";
//     domain = 'https://crs.test.harsonserver.com/#/'
// }

// if (process.env.VUE_APP_PROFILE === "pre") {
//     apiRoot = "https://hscsf-pre.dev.harsonserver.com";
//     clientSecret = "593496da-2c7a-4146-b81a-4301b66d5ef3";
// }

// if (process.env.VUE_APP_PROFILE === "production") {
//     apiRoot = "https://hscsf.cloud.harsonserver.com";
//     clientSecret = 'f40424bb-7d96-4aaa-ba75-c1dfa1505a24'
//     domain = 'https://crs.cloud.harsonserver.com/#/'
// }

// export const API_ROOT = apiRoot;
// export const CLIENT_SECRET = clientSecret;
// export const CLIENTID = clientId;
// export const APPID = appId;
// export const DOMAIN = domain



/*
 * @Author: songyingchun
 * @Date: 2023-04-18 10:10:35
 * @Description:
 */

import { setStore } from '../utils/store'

let apiRoot
let apiRootNew // 新域名
let clientSecretNew // 新域名对应参数
let clientSecret //后端提供

//主应用clientId
const clientId = 'eaf8c4c2-ce72-47c6-bdc6-b6831204097a' //平台里面创建
let clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
let tenantId = '1703586436871197732' //默认开发环境

//子应用menuId
const appId = '1534425761879654401' //平台里面创建，必改
let domain = 'https://crs.dev.harsonserver.com/#/'

if (process.env.VUE_APP_PROFILE === 'development') {
  apiRoot = 'https://hscsf.dev.harsonserver.com'
  domain = 'http://localhost:8014/#/'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'
  // clientSecret = '93f9f226-ef20-473a-b867-ffeffbbe2aca'  // 生产

  apiRootNew = 'https://ebc.dev.harsonserver.com'
  tenantId = '1703586436871197732'
  clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
  clientSecretNew = '7128ee6d-a023-4541-9e6e-d8774c96fe7a'
  //下面的代码不要动，供开发人员调试公共组件
  if (apiRoot.indexOf('hscsf.dev') != -1) {
    setStore('env', 'dev')
  }

  if (apiRoot.indexOf('test') != -1) {
    setStore('env', 'test')
  }

  if (apiRoot.indexOf('hscsf-pre') != -1) {
    setStore('env', 'pre')
  }

  if (apiRoot.indexOf('cloud') != -1) {
    setStore('env', 'cloud')
  }
}
if (process.env.VUE_APP_PROFILE === 'dev') {
  apiRoot = 'https://hscsf.dev.harsonserver.com'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'
  domain = 'https://crs.dev.harsonserver.com/#/'

  apiRootNew = 'https://ebc.dev.harsonserver.com'
  tenantId = '1703586436871197732'
  clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
  clientSecretNew = '7128ee6d-a023-4541-9e6e-d8774c96fe7a'
}

if (process.env.VUE_APP_PROFILE === 'staging') {
  apiRoot = 'https://hscsf.test.harsonserver.com'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'
  domain = 'https://crs.test.harsonserver.com/#/'

  apiRootNew = 'https://ebc.test.harsonserver.com'
  tenantId = '1703586436871197732'
  clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
  clientSecretNew = '7128ee6d-a023-4541-9e6e-d8774c96fe7a'
}

if (process.env.VUE_APP_PROFILE === 'pre') {
  apiRoot = 'https://hscsf-pre.dev.harsonserver.com'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'

  apiRootNew = 'https://ebc.dev.harsonserver.com'
  tenantId = '1703586436871197732'
  clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
  clientSecretNew = '7128ee6d-a023-4541-9e6e-d8774c96fe7a'
}

if (process.env.VUE_APP_PROFILE === 'npre') {
  apiRoot = 'https://hscsf-pre.dev.harsonserver.com'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'
  apiRootNew = 'https://ebc-npre.dev.harsonserver.com'
}

if (process.env.VUE_APP_PROFILE === 'data') {
  apiRoot = 'https://hscsf-pre.dev.harsonserver.com'
  clientSecret = '593496da-2c7a-4146-b81a-4301b66d5ef3'
  apiRootNew = 'https://ebc-data.dev.harsonserver.com'
}

if (process.env.VUE_APP_PROFILE === 'production') {
  apiRoot = 'https://hscsf.cloud.harsonserver.com'
  clientSecret = 'f40424bb-7d96-4aaa-ba75-c1dfa1505a24'
  domain = 'https://ebc.cloud.harsonserver.com/#/'

  apiRootNew = 'https://ebc-back.cloud.harsonserver.com'
  tenantId = '1703586436871197732'
  clientKey = 'efdf6663-bdb4-4194-982a-ed04dafeec7f'
  clientSecretNew = '7128ee6d-a023-4541-9e6e-d8774c96fe7a'
}

export const APPID = appId
export const DOMAIN = domain

export const API_ROOT = apiRoot
export const API_ROOT_NEW = apiRootNew
export const CLIENT_SECRET = clientSecret
export const CLIENT_SECRET_NEW = clientSecretNew
export const TENANTID = tenantId
export const CLIENTID = clientId
export const CLIENTKEY = clientKey


